package com.asj.house.client;

import com.asj.house.config.feign.HouseRoomFeignConfig;
import com.asj.house.domain.HouseRoom;
import com.asj.house.returns.RespEntity;
import com.asj.house.returns.RespTable;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(name = "houseRoomClient", url = "${manage.url}", configuration = HouseRoomFeignConfig.class)
public interface HouseRoomClient {

    /**
     * 房源列表
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/house-room/list")
    RespTable listHouseRoom(@RequestParam(value = "page", required = true) Integer page,
                            @RequestParam(value = "limit", required = true) Integer limit);

    /**
     * 搜索房源
     * @param page
     * @param limit
     * @param name
     * @return
     */
    @GetMapping("/house-room/list")
    RespTable searchHouseRoom(@RequestParam("page") Integer page,
                              @RequestParam("limit") Integer limit,
                              @RequestParam("name") String name);

    /**
     * 新增房源
     * @param houseRoom
     * @return
     */
    @PostMapping("/house-room/insert")
    RespEntity insertRoom(@RequestBody HouseRoom houseRoom);

    /**
     * 编辑房源
     * @param houseRoom
     * @return
     */
    @PutMapping("/house-room/update")
    RespEntity updateRoom(@RequestBody HouseRoom houseRoom);

    /**
     * 删除房源
     * @param roomId
     * @return
     */
    @DeleteMapping("/house-room/delete")
    RespEntity deleteRoom(@RequestParam("roomId") Integer roomId);

    /**
     * 批量删除房源
     * @param roomIds
     * @return
     */
    @DeleteMapping("/house-room/deleteBatch")
    RespEntity deleteBatchRoom(@RequestParam("roomIds") Integer[] roomIds);

}
